/*
 * ECARX Technology Limited is the owner of the copyright and the trade secret of this software.
 * Without permission, no one has the right to obtain, disclose or use this software in any way.
 */

package com.ecarx.systemui.plugin;

import android.annotation.SuppressLint;
import android.content.Context;
import android.view.View;

import com.ecarx.systemui.plugin.controller.CarSignalController;
import com.ecarx.systemui.plugin.psd.PsdBarsManager;
import com.ecarx.systemui.plugin.ui.navigationbar.NavigationBarView;

public class NavigationBar {

    private static final String TAG = "NavigationBarTag";
    private static NavigationBar navigationBar;
    private View mRootView;

    private NavigationBar(Context context) {
//        CarSignalController.init();
        startLoad(context);
    }

    public static synchronized NavigationBar init(Context context) {
        if (navigationBar == null) {
            navigationBar = new NavigationBar(context);
        }
        return navigationBar;
    }

    @SuppressLint("InflateParams")
    private void startLoad(Context context) {
//        mRootView = LayoutInflater.from(context).inflate(R.layout.navigation_bar_view, null, false);
        mRootView = new NavigationBarView(context);

        PsdBarsManager.getInstance().start();
    }

    public View getRootView() {
        mRootView.requestLayout();
        return mRootView;
    }

}
